/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.gitee.huangjianbo.supos.openapi.httpclient5.request;

import io.gitee.huangjianbo.supos.openapi.core.errors.InvalidArgumentsException;
import io.gitee.huangjianbo.supos.openapi.core.http.request.QueryParam;
import io.gitee.huangjianbo.supos.openapi.core.http.request.RequestArguments;
import io.gitee.huangjianbo.supos.openapi.core.tools.StringUtils;

/**
 *
 * @author tomcat
 * @version 1.0
 */
public class QueryRolesArgs implements RequestArguments {
    private static final long serialVersionUID = -6513355747724452575L;

    @QueryParam
    private int pageSize = 10;
    @QueryParam
    private int current = 1;
    @QueryParam
    private String keyword;
    @QueryParam
    private String companyCode = "default_org_company";
    @QueryParam
    private boolean includeDeleted = false;
    @QueryParam
    private String createTimeRange;
    @QueryParam
    private String modifyTimeRange;

    @Override
    public boolean validate() {
        if (StringUtils.isEmpty(companyCode)) {
            throw new InvalidArgumentsException("The field of company code must be not empty");
        }
        return true;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrent() {
        return current;
    }

    public void setCurrent(int current) {
        this.current = current;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public boolean isIncludeDeleted() {
        return includeDeleted;
    }

    public void setIncludeDeleted(boolean includeDeleted) {
        this.includeDeleted = includeDeleted;
    }

    public String getCreateTimeRange() {
        return createTimeRange;
    }

    public void setCreateTimeRange(String createTimeRange) {
        this.createTimeRange = createTimeRange;
    }

    public String getModifyTimeRange() {
        return modifyTimeRange;
    }

    public void setModifyTimeRange(String modifyTimeRange) {
        this.modifyTimeRange = modifyTimeRange;
    }
}
